#ifndef IPC_SHM_H
#define IPC_SHM_H

#include <stdint.h>

#define NR_CORE_MAX (64)
#define ZCELL_IPC_CONFIG_NAME "zcell_ipc_config"
#define ZCELL_IPC_MSG_POOL "zcell_msg_pool"
#define QOS_TARGET_MAX 8

struct zcell_qos_tag_t {
    uint32_t iops;  //目标服务速率 以 4K r/w 为计算
    uint32_t avg_latency; //平均延迟
};


struct zcell_ipc_config_t {
    union {
        struct {
            // int32_t  zcell_running;
            // uint32_t zcell_reactor_num;
            // int32_t  tgt_running;
            // uint32_t tgt_reactor_num;
            // int32_t  zcell_cpu_cores[NR_CORE_MAX];
            // struct spdk_ring *zcell_rings[NR_CORE_MAX];
            // // struct spdk_mempool *zcell_msg_pool[NR_CORE_MAX];
            // int32_t  tgt_cpu_cores[NR_CORE_MAX];
            // struct spdk_ring *tgt_rings[NR_CORE_MAX];
            // // struct spdk_ring *tgt_msg_pool[NR_CORE_MAX];
            // uint32_t reactor_num;

            uint32_t zcell_nr;
            uint32_t zcell_cores[NR_CORE_MAX];

            uint32_t tgt_nr;
            uint32_t tgt_cores[NR_CORE_MAX];

            //msgs
            struct spdk_mempool *msg_pool;

            //数据平面
            struct spdk_ring *rings[NR_CORE_MAX][NR_CORE_MAX];


            //Qos Tags
            // uint32_t qos_ciops; // zcell 的聚合 IOPS 
            // uint32_t qos_lat_avg; //us
            // uint32_t qos_lat_95th; //us
            // uint32_t qos_lat_99th; //us
            // uint32_t qos_lat_999th; //us
            // uint32_t qos_lat_9999th; //us


            
            uint32_t zcell_max_serve_rate; //  zcell 引擎的最大服务速率

            int qos_target_state[QOS_TARGET_MAX];

            struct zcell_qos_tag_t qos_tags[QOS_TARGET_MAX];

        };
        // uint8_t _pad[NR_CORE_MAX * NR_CORE_MAX ];
    };
};




#endif